package com.liyi.letter.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liyi.letter.system.entity.Configuration;
import com.liyi.letter.system.entity.Website;
import com.liyi.letter.system.mapper.WebsiteMapper;
import com.liyi.letter.system.service.WebsiteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author Administrator
* @description 针对表【website】的数据库操作Service实现
* @createDate 2023-06-06 10:13:35
*/
@Service
public class WebsiteServiceImpl extends ServiceImpl<WebsiteMapper, Website>
    implements WebsiteService{

    @Resource WebsiteMapper websiteMapper;
    @Override
    public Page<Website> page(Integer page, Integer pageSize, String name) {
        QueryWrapper<Website> queryWrapper = new QueryWrapper();
        if (name != null){
            queryWrapper.like("name",name);
        }
        queryWrapper.orderByDesc("id");
        Page<Website> pageInfo = new Page<>(page,pageSize);
        Page<Website> websitePage = websiteMapper.selectPage(pageInfo, queryWrapper);
        return websitePage;

    }
}




